package com.example.costumview.activity2;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.example.costumview.R;

import java.util.ArrayList;

public class StickyActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sticky);

        ListView listview = findViewById(R.id.sticky_listview);

        ArrayList<String> datas=new ArrayList<>();
        for (int i = 0; i < 50; i++) {
            datas.add("name:"+i);
        }
        ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,R.layout.item_listview,R.id.name,datas);
        listview.setAdapter(adapter);
    }
}